package com.rocksdata.mc.ui.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.ctz.commonframe.ui.widget.AbsAdapter;
import com.ctz.commonframe.ui.widget.AdapterViewHolder;
import com.ctz.commonframe.utils.GlideApp;
import com.rocksdata.mc.entity.CampusAppInfo;
import com.rocksdata.mc.R;

import java.util.List;

/**
 * Created by 陈堂正 on 2017/4/10.
 */

public class ApplicationListAdapter extends AbsAdapter<CampusAppInfo> {
    public ApplicationListAdapter(Context context, List<CampusAppInfo> datas) {
        super(context, datas, R.layout.item_application_list);
    }

    @Override
    public void convert(AdapterViewHolder holder, CampusAppInfo data) {
        ImageView ivIcon = holder.getView(R.id.iv_application_icon);
        TextView tvName = holder.getView(R.id.tv_application_name);

        GlideApp.with(context).load(data.getIcon()).into(ivIcon);
        tvName.setText(data.getName());
    }
}
